<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>z-index</title>
    <style>
        #box1, #box2, #box3 {
            width: 200px;
            height: 100px;
            position: absolute;
            color: #ffffff;
        }
        #box1 {
            background-color: red;
            left: 100px;
            z-index: 3;
        }
        #box2 {
            background-color: blue;
            top: 50px;
            left: 50px;
            z-index: 2;
        }
        #box3 {
            background-color: green;
            top: 100px;
            z-index: 1;
        }
    </style>
</head>
<body>
    <div id="box1">box 1</div>
    <div id="box2">box 2</div>
    <div id="box3">box 3</div>
</body>
</html>